import { APISAFEINDEX, GATEWAY } from '@/common';
import { request } from '../request';

// 获取事项列表
export const getMatterGropList = (params: any) =>
  request({
    url: `${APISAFEINDEX}factorGroup/list`,
    params,
  });

// 获取编号列表
export const getFactorCodeList = (params: any) =>
  request({
    url: `${APISAFEINDEX}safetyfactor/factorCodeList`,
    params,
  });

// 新增事项
export const addMatterGroup = (data: any) =>
  request({
    url: `${APISAFEINDEX}factorGroup/add`,
    data,
  });

// 修改事项
export const editMatterGroup = (data: any) =>
  request({
    url: `${APISAFEINDEX}factorGroup/edit`,
    data,
  });
// 删除事项
export const delMatterGroup = (params: any) =>
  request({
    // method: 'get',
    url: `${APISAFEINDEX}factorGroup/remove`,
    params,
  });
// 新增因子
export const addFactor = (data: any) =>
  request({
    url: `${APISAFEINDEX}safetyfactor/add`,
    data,
  });

// 修改因子
export const editFactor = (data: any) =>
  request({
    url: `${APISAFEINDEX}safetyfactor/edit`,
    data,
  });
// 删除因子
export const delFactor = (params: any) =>
  request({
    // method: 'get',
    url: `${APISAFEINDEX}safetyfactor/remove`,
    params,
  });
// 设置计算规则
export const setSimpRules = (data: any) =>
  request({
    url: `${APISAFEINDEX}safetyfactorformulasettings/saveSafetyfactorformulasettings`,
    data,
  });
// 公式详情
export const simpRulesDetail = (params: any) =>
  request({
    method: 'get',
    url: `${APISAFEINDEX}safetyfactorformulasettings/detail`,
    params,
  });
// 司机安全指数详情
export const driverSafeIndexDetail = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/driver/safetyIndex/detail`,
    params,
  });
// 企业司机安全指数详情
export const entDriverSafeIndexDetail = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/entDriver/safetyIndex/detail`,
    params,
  });
// 司机安全指数趋势图
export const driverSafetyIndexTrend = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/driver/safetyIndex/trend`,
    params,
  });
// 司机安全指数趋势图
export const entDriverSafetyIndexTrend = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/entDriver/safetyIndex/trend`,
    params,
  });
// 车辆安全指数详情
export const carSafeIndexDetail = (params: any) =>
  request({
    method: 'get',
    url: `${GATEWAY}safetyIndex/entCar/detail`,
    params,
  });
// 车辆安全指数趋势图
export const carSafetyIndexTrend = (params: any) =>
  request({
    method: 'get',
    url: `${GATEWAY}safetyIndex/entCar/SafetyIndexTrend`,
    params,
  });
// 车辆报警次数趋势图
export const getCarAlarmTrend = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/alarmTrendStatistics`,
    params,
  });
//司机报警次数趋势图
export const getDriverAlarmTrend = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/alarmTrendStatistics`,
    params,
  });
// 司机安全指数雷达图
export const postDriverSafeIndexRadarChartData = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/driver/safetyIndex/fourDimensionalGraph`,
    params,
  });

// 车辆安全指数雷达图
export const postVehicleSafeIndexRadarChartData = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/entCar/fourDimensionalGraph`,
    params,
  });
/**
 *
 * @desc 司机、车辆驾驶行为二级占比
 * @link http://apidoc.scm.logibeat.com/xiaoyaoji/doc/CjB2amTXZ
 */
export const getAlarmNameStatisticsApi = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/alarmNameStatistics`,
    params,
  });
/**
 *
 * @desc 司机安全指数同行比较
 * @link http://apidoc.scm.logibeat.com/xiaoyaoji/doc/H0IpQF8WJ
 */
export const getSafetyIndexPeerCompareApi = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/driver/safetyIndex/peerCompare`,
    params,
  });
/**
 *
 * @desc 企业司机安全指数同行比较
 * @link http://apidoc.scm.logibeat.com/xiaoyaoji/doc/H0IpQF8WJ
 */
export const getSafetyIndexEntPeerCompareApi = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/entDriver/safetyIndex/peerCompare`,
    params,
  });
/**
 *
 * @desc 企业司机驾驶行为报警次数比较
 * @link http://apidoc.scm.logibeat.com/xiaoyaoji/doc/DAyZbDK8G
 */
export const getalarmNumCompareApi = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/alarmNumCompare`,
    params,
  });
/**
 *
 * @desc 车辆安全指数同行比较
 * @link http://apidoc.scm.logibeat.com/xiaoyaoji/doc/H0IpQF8WJ
 */
export const getSafetyIndexEntCarPeerCompareApi = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/entCar/peerCompare`,
    params,
  });
/**
 *
 * @desc 司机星级统计
 * @link http://apidoc.scm.logibeat.com/xiaoyaoji/doc/CfjQM50CL
 */
export const starRatingStatisticsApi = (params: any) =>
  request({
    url: `${GATEWAY}safetyIndex/driver/starRatingStatistics`,
    params,
  });
